#define _CRT_SECURE_NO_WARNINGS

#include "Sort.h"


void Swap(int* x, int* y)
{
	int temp = *x;
	*x = *y;
	*y = temp;
}



void InsertSort(int* arr, int n)
{
	for (int i = 0; i < n - 1; i++)
	{
		int end = 1;
		int tmp = end + 1;
		while (end >= 0 && arr[end] > arr[tmp])
		{
			arr[end + 1] = arr[end];
			end--;
		}
		//Swap(&arr[tmp], &arr[end]);
		arr[end + 1] = arr[tmp];
	}
}
void ShellSort(int* arr, int n)
{
	int gap = n;
	while (gap > 1)
	{
		gap = gap / 3 + 1;
	}
}